package com.pospi.pospihold.fragment;

import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.pospi.pospihold.R;
import com.pospi.pospihold.dto.GoodsDto;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Qiyan on 2016/6/15.
 */
public class GoodsDetailFragment extends Fragment {
    public static final String PUT_SER = "goodsDetail";
    @Bind(R.id.show_iv)
    ImageView showIv;
    @Bind(R.id.name)
    TextView name;
    @Bind(R.id.price)
    TextView price;
    @Bind(R.id.add_to_cashi)
    TextView addToCashi;

    private Context context;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_goods_detail, container, false);
        context = getActivity().getApplication();
        GoodsDto dto = (GoodsDto) getArguments().getSerializable(PUT_SER);
//        Glide.with(context).load(Api.HOST + dto.getImage()).placeholder(R.drawable.noimageshow).dontAnimate().into(showIv);

        name.setText(dto.getName());
        price.setText("¥" + dto.getPrice());

        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @OnClick(R.id.add_to_cashi)
    public void onClick() {
    }


}
